package Model;

import java.io.Serializable;

import Model.Planet.Planet;
import Model.Spaceship.Spaceship;


/**
 * @author Waseem
 *
 */
public class Player implements Serializable{
	/**
	 * player spaceship
	 */
	private Spaceship ship;

	/**
	 * player name
	 */
	private String name;

	/**
	 * number of credits player has
	 */
	private double credits;

	/**
	 * pilotlevel of player
	 */
	private int pilotLevel;

	/**
	 * fighter level of player
	 */
	private int fighterLevel;

	/**
	 * trader level of player
	 */
	private int traderLevel;

	/**
	 * the static player
	 */
	private static Player player = null;

	/**
	 *  the planet the player is currently on
	 */
	private Planet currentPlanet;
	
	/**
	 * getter name
	 * @return name
	 */
	public String getName() {
		return name;
	}

	/**
 * setter name
 * @param name
 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * getter pilotlevel
	 * @return pilotlevel
	 */
	public int getPilotLevel() {
		return pilotLevel;
	}

	/**
	 * setpilotlevel
	 * @param pilotlevel
	 */
	public void setPilotLevel(int pilotLevel) {
		this.pilotLevel = pilotLevel;
	}

	/**
	 * getter for fighterlevel
	 * @return fighterlevel
	 */
	public int getFighterLevel() {
		return fighterLevel;
	}

	/**
	 * set fighterlevel
	 * @param fighterlevel
	 */
	public void setFighterLevel(int fighterLevel) {
		this.fighterLevel = fighterLevel;
	}
	
	/**
	 * getter trader level
	 * @return traderlevel
	 */
	public int getTraderLevel() {
		return traderLevel;
	}

	/**
	 * setter traderlevel
	 * @param traderlevel
	 */
	public void setTraderLevel(int traderLevel) {
		this.traderLevel = traderLevel;
	}
	
	/**
	 * getter engineerlevel
	 * @return engineerlevel
	 */
	public int getEngineerLevel() {
		return engineerLevel;
	}

	/**
	 * setter engineer level
	 * @param engineer level
	 */
	public void setEngineerLevel(int engineerLevel) {
		this.engineerLevel = engineerLevel;
	}

	/**
	 * getter space ship
	 * @return Spaceship
	 */
	public Spaceship getShip() {
		return ship;
	}

	/**
	 * 
	 */
	private int engineerLevel;

	/**
	 * get the instance
	 */
	public static Player getInstance(){
		if(player == null){
			player = new Player();
			return player;
		}
		
		return player;
	}

	/**
	 * getter ship
	 * @return ship
	 * 
	 */
	public void setShip(Spaceship ship){
		this.ship = ship;
	}

	/**
	 * getter ceredets
	 * @return credits
	 */
	public double getCredits() {
		return credits;
	}

	/**
 * setter credits
 * @param d
 * 
 */
	public void setCredits(double credits) {
		this.credits = credits;
	}

	/**
 * getter planet
 * @return currentPlanet
 */
	public Planet getCurrentPlanet() {
		return currentPlanet;
	}

	/**
 * set plane
 * @param currentPlanet
 */
	public void setCurrentPlanet(Planet currentPlanet) {
		this.currentPlanet = currentPlanet;
	}
	
	/**
	 * setter for player
	 * @param p
	 */
	public static void setPlayer(Player p){
	    player = p;
	}
	
	public String toString(){
		return super.toString();
	}

}
